RateApp

object RateApp : Base<RateApp>

Set of utilities to invite the user to rate the app.

Functions

Link copied to clipboard
fun checkAndShow(activity: Activity)

Checks if the all conditions to show the flow are met, and shows the flow only if the all conditions are met.

Link copied to clipboard
fun goToRateInGooglePlay(activity: Activity)

Directs the user to the app details on Google Play so they can rate the app. If is possible, open the details directly in the Google Play app, if is not possible, open it in the browser, if it is not possible either, show a toast with a message.

Link copied to clipboard
fun init(context: Context)

Initialize and configure the utility, it must always be called only once from the app.

Properties

Link copied to clipboard
var firebaseAnalyticsEnabled: Boolean

Determines if the event log in Firebase Analytics is enabled for the class instance, for the event log, the static property of the companion object firebaseAnalyticsInstance must also be assigned, if that property is null, no events will be logged, since what is required.

Link copied to clipboard
var minInstallElapsedDays: Int = 10

Minimum number of days required since the app was installed to be able to show the flow, it is used in combination with minInstallLaunchTimes, and both conditions must be met to show the flow, the minimum value is 0 (it is shown from that same day).

Link copied to clipboard
var minInstallLaunchTimes: Int = 10

Minimum number of times the app must have been launched since it was installed to be able to show the flow, it is used in combination with minInstallElapsedDays, and both conditions must be met to show the flow, the minimum value is 1 (shown from first launch).

Link copied to clipboard
var minRemindElapsedDays: Int = 2

Minimum number of days required since the flow was shown to show it again, it is used in combination with minRemindLaunchTimes, and both conditions must be met to show the flow, the minimum value is 0 (it is shown from that same day).

Link copied to clipboard
var minRemindLaunchTimes: Int = 4

Minimum number of times the app must have been launched since it showed the flow to show it again, it is used in combination with minRemindElapsedDays, and both conditions must be met to show the flow, the minimum value is 1 (it is shown from the first launch).

Link copied to clipboard
var showAtEvent: Int = 2

Indicates in which call to checkAndShow() the flow will be shown.

Link copied to clipboard
var showNeverAskAgainButton: Boolean = true

For versions prior to Android 5, where the dialog to invite the user to rate app is showing, it allows setting the visibility of the never ask again button.